{template 'common/header'}
<div class="main">

    <div class="panel panel-info">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
        	<input type="hidden" name="m" value="lorn_2048" />
        	<input type="hidden" name="do" value="record" />
			<div class="form-group">
			    <label class=" col-md-2 col-lg-1 control-label">活动ID</label>
			    <div class="col-sm-2 col-lg-3">
					<input class="form-control" name="aid" id="" placeholder="请输入活动" type="text" value="{$_GPC['aid']}">
				</div>
				<label class=" col-md-2 col-lg-1 control-label">用户名</label>
				<div class="col-sm-2 col-lg-3">
					<input class="form-control" name="keyword" id="" placeholder="请输入名称" type="text" value="{$_GPC['keyword']}">
				</div>
                <div class=" col-xs-6 col-sm-2 col-lg-2">
					<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
				</div>
			</div>
		</form>
	</div>
    </div>
    <div style="padding:15px;">
        <table class="table table-hover">
            <thead class="navbar-inner">
                <tr><th  width="50">ID</th>	
                    <th>活动ID</th>	
                    <th>用户名</th>
                    <th>分数</th>
                    <th>游戏时间</th>
                    <th>创建时间</th>
                    <th style="text-align:center;">操作</th>
                </tr>
            </thead>
            <tbody>
                {loop $list $row}
                <tr>
                    <td>{$row['id']}</td>
                    <td>{$row['gid']}</td>
              
                    <td >{$row['username']}</td>
                    <td>{$row['score']}</td>
                    <td>{php echo date('Y-m-d H:i:s',$row['playtime'])}</td>
                    <td>{php echo date('Y-m-d H:i:s',$row['addtime'])}</td>
                    <td style="text-align:center; width:80px;">
                    
                          <a rel="tooltip" href="#" onclick="drop_confirm('您确定要删除吗?删除不可恢复，同时删除所有相关数据！', '{php echo $this->createWebUrl('del_record',array('id'=>$row['id']))}');" title="删除">删除</a>
                    
                    </td>
                </tr>
                {/loop}
            </tbody>
        </table>
        {$pager}
    </div>

</div>
<script>
$(function(){

            $(".check_all").click(function(){
            var checked = $(this).get(0).checked;
                    $("input[type=checkbox]").attr("checked", checked);
            });
                    $("input[name=deleteall]").click(function(){

            var check = $("input:checked");
                    if (check.length < 1){
            err('请选择要删除的记录!');
                    return false;
            }
            if (confirm("确认要删除选择的记录?")){
            var id = new Array();
                    check.each(function(i){
                    id[i] = $(this).val();
                    });
                    $.post('{php echo create_url('site/module', array('do' => 'deleteAll', 'name' => 'tyzm_pintu'))}', {idArr:id}, function(data){
                    if (data.errno == 0)
                    {
                    location.reload();
                    } else {
                    alert(data.error);
                    }


                    }, 'json');
            }

            });
			
			

$(".audit").click(function(){
    var clickthis=$(this);
    var did=clickthis.attr('data-id');
	var audit=clickthis.attr('data-s');
	$.ajax({
		type : "post",
		url : "{php echo $this->createWebUrl('ajaxset',array('rid'=>$_GPC['rid'],'ty'=>'audit'))}",
		data : {
			id : did,
			audit : audit,
		},
		dataType : "json",
		success : function(res) {
			if (res.status == 200) {
			    clickthis.attr('data-s',(1-audit));
				if(clickthis.hasClass('label-success')){
				    clickthis.removeClass("label-success");
                    clickthis.addClass('label-info');
					clickthis.html('待审核');
                }else{
				    clickthis.removeClass("label-info");
				    clickthis.addClass('label-success');
					clickthis.html('已审核');
				}
			}
		}

	});
});		
			
			
			
			
			
			
			
			
                    });</script>
<script>
            function drop_confirm(msg, url){
            if (confirm(msg)){
            window.location = url;
            }
            }
</script>

{template 'common/footer'}